#include "MsgProcess.h"
#include <iostream>
#include <UserMgr.h>
#include <Events.h>
#include "hv/requests.h"

extern std::shared_ptr<UserMgr> gUserMgr;

void WINAPI vxWorkClinetConnet(int clientId)
{
    std::cout << " new client " << clientId << std::endl;
}


void WINAPI vxWorkClinetClose(int clientId)
{
    std::cout << " close client " << clientId << std::endl;
}

void WINAPI vxWorkClinetRecviceData(int clientId, char * data, int len)
{
    std::string szData(data);
    Json::Reader reader;
    Json::Value root;

    reader.parse(szData, root);
    root["clientId"] = clientId;

    gUserMgr->ProcMsg(root);
    std::cout << root.toStyledString() << std::endl;
}